/**
 * I think element-ui's default theme color is too light for long-term use.
 * So I modified the default color and you can modify it to your liking.
**/

@import './variables.module.scss';

/* theme color */
:root {
  --el-color-primary: #1890ff;
  --el-color-primary-light-1: #40a9ff;
  --el-color-primary-light-2: #69c0ff;
  --el-color-primary-light-3: #91d5ff;
  --el-color-primary-light-4: #bae7ff;
  --el-color-primary-light-5: #e6f7ff;
  --el-color-primary-light-6: #e6f7ff;
  --el-color-primary-light-7: #e6f7ff;
  --el-color-primary-light-8: #e6f7ff;
  --el-color-primary-light-9: #e6f7ff;
  --el-color-primary-dark-2: #096dd9;
}

// 现代化 Element Plus 样式覆盖

// 面包屑导航
.el-breadcrumb__inner,
.el-breadcrumb__inner a {
  font-weight: 500 !important;
  color: $gray-600;
  transition: $transition-base;
  
  &:hover {
    color: $primary;
  }
}

.el-breadcrumb__separator {
  color: $gray-400;
}

.el-upload {
  input[type="file"] {
    display: none !important;
  }
}

.el-upload__input {
  display: none;
}

.cell {
  .el-tag {
    margin-right: 0px;
  }
}

.small-padding {
  .cell {
    padding-left: 5px;
    padding-right: 5px;
  }
}

.fixed-width {
  .el-button--mini {
    padding: 7px 10px;
    width: 60px;
  }
}

.status-col {
  .cell {
    padding: 0 10px;
    text-align: center;

    .el-tag {
      margin-right: 0px;
    }
  }
}

// to fixed https://github.com/ElemeFE/element/issues/2461
.el-dialog {
  transform: none;
  left: 0;
  position: relative;
  margin: 0 auto;
}

// refine element ui upload
.upload-container {
  .el-upload {
    width: 100%;

    .el-upload-dragger {
      width: 100%;
      height: 200px;
    }
  }
}

// dropdown
.el-dropdown-menu {
  a {
    display: block
  }
}

// fix date-picker ui bug in filter-item
.el-range-editor.el-input__inner {
  display: inline-flex !important;
}

// to fix el-date-picker css style
.el-range-separator {
  box-sizing: content-box;
}

.el-menu--collapse
  > div
  > .el-submenu
  > .el-submenu__title
  .el-submenu__icon-arrow {
  display: none;
}

.el-dropdown .el-dropdown-link{
  color: var(--el-color-primary) !important;
}

// 表格样式优化
.el-table {
  border-radius: $border-radius-base;
  overflow: hidden;
  box-shadow: $box-shadow-light;
  
  .el-table__header-wrapper, .el-table__fixed-header-wrapper {
    th {
      word-break: break-word;
      background-color: $gray-50 !important;
      color: $gray-700;
      height: 48px !important;
      font-size: 14px;
      font-weight: 600;
      border-bottom: 1px solid $gray-200;
    }
  }
  
  .el-table__body-wrapper {
    .el-table__row {
      transition: $transition-base;
      
      &:hover {
        background-color: $gray-50;
      }
    }
    
    .el-button [class*="el-icon-"] + span {
      margin-left: 4px;
    }
  }
  
  .el-table__cell {
    padding: 12px 0;
    border-bottom: 1px solid $gray-100;
  }
}

// 按钮样式优化
.el-button {
  border-radius: $border-radius-base;
  font-weight: 500;
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: $box-shadow-base;
  }
  
  &.el-button--primary {
    background: $primary !important;
    border-color: $primary !important;
    color: white !important;
    
    &:hover {
      background: $primary-dark !important;
      border-color: $primary-dark !important;
    }
  }
  
  &.el-button--success {
    background: $success !important;
    border-color: $success !important;
    color: white !important;
    
    &:hover {
      background: $success-dark !important;
      border-color: $success-dark !important;
    }
  }
}

// 表单样式优化
.el-form {
  .el-form-item {
    margin-bottom: 24px;
    
    .el-form-item__label {
      font-weight: 500;
      color: $gray-700;
      line-height: 1.5;
    }
    
    .el-form-item__error {
      font-size: 12px;
      color: $error;
      margin-top: 4px;
    }
  }
  
  .el-input {
    .el-input__inner {
      border-radius: $border-radius-base;
      transition: $transition-base;
      
      &:focus {
        border-color: $primary !important;
        box-shadow: 0 0 0 2px rgba($primary, 0.1) !important;
      }
    }
  }
  
  .el-select {
    .el-input__inner {
      cursor: pointer;
    }
  }
}

// 图片预览弹窗样式优化
.el-image-viewer__wrapper {
  background-color: rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(10px);
  
  .el-image-viewer__btn {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: $border-radius-base !important;
    backdrop-filter: blur(10px);
    transition: $transition-base !important;
    
    &:hover {
      background-color: rgba(255, 255, 255, 0.2) !important;
      transform: scale(1.1);
    }
  }
  
  .el-image-viewer__close {
    top: 20px !important;
    right: 20px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 20px !important;
  }
  
  .el-image-viewer__prev,
  .el-image-viewer__next {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
  
  .el-image-viewer__actions {
    bottom: 30px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    border-radius: 25px !important;
    padding: 8px 16px !important;
    backdrop-filter: blur(10px);
    
    .el-image-viewer__actions__inner {
      .el-image-viewer__action {
        margin: 0 8px !important;
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        
        &:hover {
          background-color: rgba(255, 255, 255, 0.2) !important;
        }
      }
    }
  }
  
  .el-image-viewer__img {
    border-radius: $border-radius-base !important;
    box-shadow: $box-shadow-heavy !important;
    transition: transform 0.3s ease !important;
  }
}